import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class StorageService {

  constructor() { //构造函数
  }
  setItem(key:any,value:any){
    localStorage.setItem(key,JSON.stringify(value))
  }
  getItem(key:any){
    return JSON.parse(<string>localStorage.getItem(key));
  }
  removeItem(key:any){
    localStorage.removeItem(key)
  }
}
